#include <iostream>
#include "Arraylist.cpp"



class Point{


public:
    int x;
    int y;
    Point()
    {
        cout<<"[-----------  Point()--------- ]"<<endl;//flush
    }
    Point(int x,int y)
    {
        this->x = x;
        this->y = y;
        cout<<"[----------- Point(int x,int y)--------- ]"<<endl;//flush
    }
    Point(Point &p)
    {
        this->x = *new int;
        this->x = p.x;
        this->y = *new int;
        this->y = p.y;
        cout<<"[-----------  Point(Point &p)--------- ]"<<endl;//flush
    }
    ~Point()
    {
        cout<<"[-----------~Point--------- ]"<<endl;//flush
    }
    string tostring(){
        cout<<"[ ";
        cout << "x:" << x ;
        cout << "y:" << y ;
        cout<<"]"<<endl;//flush
    }
};


int main() {

//    ArrayList<int> list;
//    list.add(10);
//    list.add(20);
//    list.add(30);
//    list.add(40);
//
//
//    for (int i = 0; i < list.getLength(); ++i) {
//        std::cout << "data:" << *list.get(i) << std::endl;
//    }

    ArrayList<Point> points;
    Point p1(1,2);
    Point p2(3,4);
    Point p3(5,6);
    Point p4(7,8);
    points.add(p1);
    points.add(p2);
    points.add(p3);
    points.add(p4);

    for (int i = 0; i < points.getLength(); ++i) {

        Point* p = points.get(i);
        cout << p->x << "," << p->y <<endl;
    }

    return 0;
}
